﻿// MyNotes - Free Sticky Notes
// Copyright (C) 2011 Alexandre Vicenzi
// 
// This program is free software; you can redistribute it and/or modify it under 
// the terms of the GNU General Public License as published by the Free Software 
// Foundation; either version 3 of the License, or (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful, but WITHOUT 
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along with 
// this program; if not, write to the Free Software Foundation, Inc., 
// 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MyNotes
{
    public partial class FrmPrincipal : Form
    {
        public FrmPrincipal()
        {
            InitializeComponent();
            /*listView1.View = View.Tile;
            listView1.TileSize = new Size(400, 65);
            listView1.Columns.AddRange(new ColumnHeader[] { new ColumnHeader(), new ColumnHeader(), new ColumnHeader() });
            ListViewItem item0 = new ListViewItem(new string[] 
            {"Teste", 
            "Data 1/1", 
            "Data2 1/2"}, 0);

            listView1.Items.Add(item0);
            // Initialize myListView.
            /*
            listView1.Dock = DockStyle.Fill;
            listView1.View = View.Tile;

            // Initialize the tile size.
            listView1.TileSize = new Size(400, 45);

            // Initialize the item icons.
            

            // Add column headers so the subitems will appear.
            listView1.Columns.AddRange(new ColumnHeader[] { new ColumnHeader(), new ColumnHeader(), new ColumnHeader() });

            // Create items and add them to myListView.
            ListViewItem item0 = new ListViewItem(new string[] 
            {"Programming Windows", 
            "Petzold, Charles", 
            "1998"}, 0);
            ListViewItem item1 = new ListViewItem(new string[] 
            {"Code: The Hidden Language of Computer Hardware and Software", 
            "Petzold, Charles", 
            "2000"}, 0);
            ListViewItem item2 = new ListViewItem(new string[] 
            {"Programming Windows with C#", 
            "Petzold, Charles", 
            "2001"}, 0);
            ListViewItem item3 = new ListViewItem(new string[] 
            {"Coding Techniques for Microsoft Visual Basic .NET", 
            "Connell, John", 
            "2001"}, 0);
            ListViewItem item4 = new ListViewItem(new string[] 
            {"C# for Java Developers", 
            "Jones, Allen & Freeman, Adam", 
            "2002"}, 0);
            ListViewItem item5 = new ListViewItem(new string[] 
            {"Microsoft .NET XML Web Services Step by Step", 
            "Jones, Allen & Freeman, Adam", 
            "2002"}, 0);
            listView1.Items.AddRange(
                new ListViewItem[] { item0, item1, item2, item3, item4, item5 });

            // Initialize the form.
            
            this.Text = "ListView Tiling Example";
            */
        }

        public void ShowAbout(bool showInTaskbar)
        {
            AboutBox ab = new AboutBox();
            ab.ShowInTaskbar = showInTaskbar;
            ab.Visible = true;
        }

        public void ShowOptions(bool showInTaskbar)
        {
            FrmConfig fc = new FrmConfig();
            fc.ShowInTaskbar = showInTaskbar;
            fc.Visible = true;
        }

        private void miOptions_Click(object sender, EventArgs e)
        {
            ShowOptions(false);
        }

        private void miAbout_Click(object sender, EventArgs e)
        {
            ShowAbout(false);
        }

        private void miNote_Click(object sender, EventArgs e)
        {
            Annotation note = new Annotation(AnnotationType.Text, Configurations.DefaultColorNote);
        }

        private void miNewAnnotation_Click(object sender, EventArgs e)
        {
            mnAnnotation.PerformClick();
        }

        private void miExit_Click(object sender, EventArgs e)
        {
            Application.ExitThread();
            Application.Exit();
        }

        private void miManager_Click(object sender, EventArgs e)
        {
            this.ShowInTaskbar = true;
            this.WindowState = FormWindowState.Normal;
            this.Visible = true;
        }

        private void FrmPrincipal_FormClosing(object sender, FormClosingEventArgs e)
        {
            e.Cancel = true;
            this.ShowInTaskbar = false;
            this.Visible = false;
        }

        private void miOpt_Click(object sender, EventArgs e)
        {
            ShowOptions(true);
        }

        private void miAboutForm_Click(object sender, EventArgs e)
        {
            ShowAbout(true);
        }

        private void FrmPrincipal_Activated(object sender, EventArgs e)
        {
            this.tvNotes.ExpandAll();
        }

    }
}
